//********************************************************
//
// ABEC Lumped Element Script
// Project: Horn H 400 LE
//
//********************************************************

// Lumped Element script for compression driver
// with ferro-fluid in voice-coil gap.
// Models also first part of horn with the help of a 
// Waveguide element.


// Driving voltage of whole simulation.
// DrvValue is here calculated with the help of an inline-formula (dB->Volt).
// "IsRms" marks the input as being specified as an rms-value.
// (By default a peak-value is assumed)

Def_Driving
  Value={ 10^((-30+20)/20) }  // -30dBV + 20dB amplifier
  IsRms

  
// Definition of electro-dynamical driver.  
// Here we need diaphragm dimensions because diaphragm of
// Def_Driver is connected to Lumped Element network and
// not, as in other examples, only to Boundary Element domain.

Def_Driver  'Drv1'
  dD=44mm                  // Diameter of diaphragm
  Mms=0.5g                 // Mass of vibrating assembly
  Cms=10e-6m/N             // Compliance of suspensions
  Rms=4Ns/m                // Mech resistances
  Bl=5Tm                   // Motor force factor
  Re=6.7ohm                // Electrical DC resistance of VC 
  fre=50kHz  ExpoRe=1      // HF modifier of real-part of VC-impedance
  Le=0.1mH  ExpoLe=0.618   // HF modifier of imag-part of VC-impedance


// System S1 models the compression-driver plus horn-stub.

System 'S1'

  // Electro-dynamic driver.
  // Electrical terminals are from Node=1=0.
  // Acoustical front-terminal is Node=10.
  // Acoustical rear-terminal is Node=20. 
  
  Driver  Def='Drv1'  Node=1=0=10=20
  
  
  // Rear enclosure
  
  Enclosure  'Eb'  Node=20
    Vb=120cm3              // Effective size of volume  
    Qb/fo=0.1              // Loss factor
    
    
  // Compression chamber of height H.
  // Modelled with the help of an acoustical compliance. Mass ignored.
  // Using inline-formula. Value of last formula gets assigned to Vb=. 
  
  Enclosure 'Ef'  Node=10
    Vb={ dD=44e-3; H=0.5e-3; SD=pi*sqr(dD/2); Vb=SD*H }
    
    
  // Phase-plug between compression chamber and horn-stub.
  // Normally phase-plugs are a complicated system of slits.
  // Here we simplify by lumping all pathes into a single waveguide.
  // Note that Waveguide provides modal response along the waveguide.
  
  Waveguide  'W1' Node=10=300
    STh=3cm2  dMo=1in  Len=22mm  Conical
    
    
  // Horn stub.
  // Here the first part of the horn is modelled with a Waveguide
  // element, which provides modal response along the waveguide,
  // but no cross-modes.
  // The reason not modelling this part also with the help of BE is
  // to demonstrate acoustic coupling. 
  
  Waveguide  'W2' Node=300=400
    dTh=1in  dMo=2in  Len=76.5mm  Conical
  
    
  // Horn modelled with Boundary Element Domain.
  // Coupling is via DrvGroup=1001.
  
  RadImp 'Throat'
    Node=400  DrvGroup=1001

